// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file MonitoringTopicsTypeObjectSupport.cxx
 * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file
 *
 * This file was generated by the tool fastddsgen.
 */

#include <ddspipe_core/types/monitoring/topics/MonitoringTopicsTypeObjectSupport.hpp>

#include <mutex>
#include <string>

#include <fastcdr/xcdr/external.hpp>
#include <fastcdr/xcdr/optional.hpp>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/log/Log.hpp>
#include <fastdds/dds/xtypes/common.hpp>
#include <fastdds/dds/xtypes/type_representation/ITypeObjectRegistry.hpp>
#include <fastdds/dds/xtypes/type_representation/TypeObject.hpp>
#include <fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp>

#include <ddspipe_core/types/monitoring/topics/MonitoringTopics.hpp>


using namespace eprosima::fastdds::dds::xtypes;

// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method
void register_DdsTopicData_type_identifier(
        TypeIdentifierPair& type_ids_DdsTopicData)
{

    ReturnCode_t return_code_DdsTopicData {eprosima::fastdds::dds::RETCODE_OK};
    return_code_DdsTopicData =
        eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
        "DdsTopicData", type_ids_DdsTopicData);
    if (eprosima::fastdds::dds::RETCODE_OK != return_code_DdsTopicData)
    {
        StructTypeFlag struct_flags_DdsTopicData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
                false, false);
        QualifiedTypeName type_name_DdsTopicData = "DdsTopicData";
        eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_DdsTopicData;
        eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_DdsTopicData;
        CompleteTypeDetail detail_DdsTopicData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DdsTopicData, ann_custom_DdsTopicData, type_name_DdsTopicData.to_string());
        CompleteStructHeader header_DdsTopicData;
        header_DdsTopicData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DdsTopicData);
        CompleteStructMemberSeq member_seq_DdsTopicData;
        {
            TypeIdentifierPair type_ids_participant_id;
            ReturnCode_t return_code_participant_id {eprosima::fastdds::dds::RETCODE_OK};
            return_code_participant_id =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "anonymous_string_unbounded", type_ids_participant_id);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_participant_id)
            {
                {
                    SBound bound = 0;
                    StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound);
                    if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                            TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn,
                            "anonymous_string_unbounded", type_ids_participant_id))
                    {
                        EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type.");
                    }
                }
            }
            StructMemberFlag member_flags_participant_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_participant_id = 0x00000000;
            bool common_participant_id_ec {false};
            CommonStructMember common_participant_id {TypeObjectUtils::build_common_struct_member(member_id_participant_id, member_flags_participant_id, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_participant_id, common_participant_id_ec))};
            if (!common_participant_id_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure participant_id member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_participant_id = "participant_id";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_participant_id;
            ann_custom_DdsTopicData.reset();
            CompleteMemberDetail detail_participant_id = TypeObjectUtils::build_complete_member_detail(name_participant_id, member_ann_builtin_participant_id, ann_custom_DdsTopicData);
            CompleteStructMember member_participant_id = TypeObjectUtils::build_complete_struct_member(common_participant_id, detail_participant_id);
            TypeObjectUtils::add_complete_struct_member(member_seq_DdsTopicData, member_participant_id);
        }
        {
            TypeIdentifierPair type_ids_msgs_lost;
            ReturnCode_t return_code_msgs_lost {eprosima::fastdds::dds::RETCODE_OK};
            return_code_msgs_lost =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "_uint32_t", type_ids_msgs_lost);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_msgs_lost)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                        "msgs_lost Structure member TypeIdentifier unknown to TypeObjectRegistry.");
                return;
            }
            StructMemberFlag member_flags_msgs_lost = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_msgs_lost = 0x00000001;
            bool common_msgs_lost_ec {false};
            CommonStructMember common_msgs_lost {TypeObjectUtils::build_common_struct_member(member_id_msgs_lost, member_flags_msgs_lost, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_msgs_lost, common_msgs_lost_ec))};
            if (!common_msgs_lost_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure msgs_lost member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_msgs_lost = "msgs_lost";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_msgs_lost;
            ann_custom_DdsTopicData.reset();
            CompleteMemberDetail detail_msgs_lost = TypeObjectUtils::build_complete_member_detail(name_msgs_lost, member_ann_builtin_msgs_lost, ann_custom_DdsTopicData);
            CompleteStructMember member_msgs_lost = TypeObjectUtils::build_complete_struct_member(common_msgs_lost, detail_msgs_lost);
            TypeObjectUtils::add_complete_struct_member(member_seq_DdsTopicData, member_msgs_lost);
        }
        {
            TypeIdentifierPair type_ids_msgs_received;
            ReturnCode_t return_code_msgs_received {eprosima::fastdds::dds::RETCODE_OK};
            return_code_msgs_received =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "_uint32_t", type_ids_msgs_received);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_msgs_received)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                        "msgs_received Structure member TypeIdentifier unknown to TypeObjectRegistry.");
                return;
            }
            StructMemberFlag member_flags_msgs_received = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_msgs_received = 0x00000002;
            bool common_msgs_received_ec {false};
            CommonStructMember common_msgs_received {TypeObjectUtils::build_common_struct_member(member_id_msgs_received, member_flags_msgs_received, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_msgs_received, common_msgs_received_ec))};
            if (!common_msgs_received_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure msgs_received member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_msgs_received = "msgs_received";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_msgs_received;
            ann_custom_DdsTopicData.reset();
            CompleteMemberDetail detail_msgs_received = TypeObjectUtils::build_complete_member_detail(name_msgs_received, member_ann_builtin_msgs_received, ann_custom_DdsTopicData);
            CompleteStructMember member_msgs_received = TypeObjectUtils::build_complete_struct_member(common_msgs_received, detail_msgs_received);
            TypeObjectUtils::add_complete_struct_member(member_seq_DdsTopicData, member_msgs_received);
        }
        {
            TypeIdentifierPair type_ids_msg_rx_rate;
            ReturnCode_t return_code_msg_rx_rate {eprosima::fastdds::dds::RETCODE_OK};
            return_code_msg_rx_rate =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "_double", type_ids_msg_rx_rate);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_msg_rx_rate)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                        "msg_rx_rate Structure member TypeIdentifier unknown to TypeObjectRegistry.");
                return;
            }
            StructMemberFlag member_flags_msg_rx_rate = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_msg_rx_rate = 0x00000003;
            bool common_msg_rx_rate_ec {false};
            CommonStructMember common_msg_rx_rate {TypeObjectUtils::build_common_struct_member(member_id_msg_rx_rate, member_flags_msg_rx_rate, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_msg_rx_rate, common_msg_rx_rate_ec))};
            if (!common_msg_rx_rate_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure msg_rx_rate member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_msg_rx_rate = "msg_rx_rate";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_msg_rx_rate;
            ann_custom_DdsTopicData.reset();
            CompleteMemberDetail detail_msg_rx_rate = TypeObjectUtils::build_complete_member_detail(name_msg_rx_rate, member_ann_builtin_msg_rx_rate, ann_custom_DdsTopicData);
            CompleteStructMember member_msg_rx_rate = TypeObjectUtils::build_complete_struct_member(common_msg_rx_rate, detail_msg_rx_rate);
            TypeObjectUtils::add_complete_struct_member(member_seq_DdsTopicData, member_msg_rx_rate);
        }
        CompleteStructType struct_type_DdsTopicData = TypeObjectUtils::build_complete_struct_type(struct_flags_DdsTopicData, header_DdsTopicData, member_seq_DdsTopicData);
        if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                TypeObjectUtils::build_and_register_struct_type_object(struct_type_DdsTopicData, type_name_DdsTopicData.to_string(), type_ids_DdsTopicData))
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                    "DdsTopicData already registered in TypeObjectRegistry for a different type.");
        }
    }
}
// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method
void register_DdsTopic_type_identifier(
        TypeIdentifierPair& type_ids_DdsTopic)
{

    ReturnCode_t return_code_DdsTopic {eprosima::fastdds::dds::RETCODE_OK};
    return_code_DdsTopic =
        eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
        "DdsTopic", type_ids_DdsTopic);
    if (eprosima::fastdds::dds::RETCODE_OK != return_code_DdsTopic)
    {
        StructTypeFlag struct_flags_DdsTopic = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
                false, false);
        QualifiedTypeName type_name_DdsTopic = "DdsTopic";
        eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_DdsTopic;
        eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_DdsTopic;
        CompleteTypeDetail detail_DdsTopic = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DdsTopic, ann_custom_DdsTopic, type_name_DdsTopic.to_string());
        CompleteStructHeader header_DdsTopic;
        header_DdsTopic = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DdsTopic);
        CompleteStructMemberSeq member_seq_DdsTopic;
        {
            TypeIdentifierPair type_ids_name;
            ReturnCode_t return_code_name {eprosima::fastdds::dds::RETCODE_OK};
            return_code_name =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "anonymous_string_unbounded", type_ids_name);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_name)
            {
                {
                    SBound bound = 0;
                    StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound);
                    if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                            TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn,
                            "anonymous_string_unbounded", type_ids_name))
                    {
                        EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type.");
                    }
                }
            }
            StructMemberFlag member_flags_name = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_name = 0x00000000;
            bool common_name_ec {false};
            CommonStructMember common_name {TypeObjectUtils::build_common_struct_member(member_id_name, member_flags_name, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_name, common_name_ec))};
            if (!common_name_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure name member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_name = "name";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_name;
            ann_custom_DdsTopic.reset();
            CompleteMemberDetail detail_name = TypeObjectUtils::build_complete_member_detail(name_name, member_ann_builtin_name, ann_custom_DdsTopic);
            CompleteStructMember member_name = TypeObjectUtils::build_complete_struct_member(common_name, detail_name);
            TypeObjectUtils::add_complete_struct_member(member_seq_DdsTopic, member_name);
        }
        {
            TypeIdentifierPair type_ids_type_name;
            ReturnCode_t return_code_type_name {eprosima::fastdds::dds::RETCODE_OK};
            return_code_type_name =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "anonymous_string_unbounded", type_ids_type_name);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_type_name)
            {
                {
                    SBound bound = 0;
                    StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound);
                    if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                            TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn,
                            "anonymous_string_unbounded", type_ids_type_name))
                    {
                        EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type.");
                    }
                }
            }
            StructMemberFlag member_flags_type_name = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_type_name = 0x00000001;
            bool common_type_name_ec {false};
            CommonStructMember common_type_name {TypeObjectUtils::build_common_struct_member(member_id_type_name, member_flags_type_name, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_type_name, common_type_name_ec))};
            if (!common_type_name_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure type_name member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_type_name = "type_name";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_type_name;
            ann_custom_DdsTopic.reset();
            CompleteMemberDetail detail_type_name = TypeObjectUtils::build_complete_member_detail(name_type_name, member_ann_builtin_type_name, ann_custom_DdsTopic);
            CompleteStructMember member_type_name = TypeObjectUtils::build_complete_struct_member(common_type_name, detail_type_name);
            TypeObjectUtils::add_complete_struct_member(member_seq_DdsTopic, member_type_name);
        }
        {
            TypeIdentifierPair type_ids_type_discovered;
            ReturnCode_t return_code_type_discovered {eprosima::fastdds::dds::RETCODE_OK};
            return_code_type_discovered =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "_bool", type_ids_type_discovered);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_type_discovered)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                        "type_discovered Structure member TypeIdentifier unknown to TypeObjectRegistry.");
                return;
            }
            StructMemberFlag member_flags_type_discovered = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_type_discovered = 0x00000002;
            bool common_type_discovered_ec {false};
            CommonStructMember common_type_discovered {TypeObjectUtils::build_common_struct_member(member_id_type_discovered, member_flags_type_discovered, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_type_discovered, common_type_discovered_ec))};
            if (!common_type_discovered_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure type_discovered member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_type_discovered = "type_discovered";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_type_discovered;
            ann_custom_DdsTopic.reset();
            CompleteMemberDetail detail_type_discovered = TypeObjectUtils::build_complete_member_detail(name_type_discovered, member_ann_builtin_type_discovered, ann_custom_DdsTopic);
            CompleteStructMember member_type_discovered = TypeObjectUtils::build_complete_struct_member(common_type_discovered, detail_type_discovered);
            TypeObjectUtils::add_complete_struct_member(member_seq_DdsTopic, member_type_discovered);
        }
        {
            TypeIdentifierPair type_ids_type_mismatch;
            ReturnCode_t return_code_type_mismatch {eprosima::fastdds::dds::RETCODE_OK};
            return_code_type_mismatch =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "_bool", type_ids_type_mismatch);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_type_mismatch)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                        "type_mismatch Structure member TypeIdentifier unknown to TypeObjectRegistry.");
                return;
            }
            StructMemberFlag member_flags_type_mismatch = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_type_mismatch = 0x00000003;
            bool common_type_mismatch_ec {false};
            CommonStructMember common_type_mismatch {TypeObjectUtils::build_common_struct_member(member_id_type_mismatch, member_flags_type_mismatch, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_type_mismatch, common_type_mismatch_ec))};
            if (!common_type_mismatch_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure type_mismatch member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_type_mismatch = "type_mismatch";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_type_mismatch;
            ann_custom_DdsTopic.reset();
            CompleteMemberDetail detail_type_mismatch = TypeObjectUtils::build_complete_member_detail(name_type_mismatch, member_ann_builtin_type_mismatch, ann_custom_DdsTopic);
            CompleteStructMember member_type_mismatch = TypeObjectUtils::build_complete_struct_member(common_type_mismatch, detail_type_mismatch);
            TypeObjectUtils::add_complete_struct_member(member_seq_DdsTopic, member_type_mismatch);
        }
        {
            TypeIdentifierPair type_ids_qos_mismatch;
            ReturnCode_t return_code_qos_mismatch {eprosima::fastdds::dds::RETCODE_OK};
            return_code_qos_mismatch =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "_bool", type_ids_qos_mismatch);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_qos_mismatch)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                        "qos_mismatch Structure member TypeIdentifier unknown to TypeObjectRegistry.");
                return;
            }
            StructMemberFlag member_flags_qos_mismatch = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_qos_mismatch = 0x00000004;
            bool common_qos_mismatch_ec {false};
            CommonStructMember common_qos_mismatch {TypeObjectUtils::build_common_struct_member(member_id_qos_mismatch, member_flags_qos_mismatch, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_qos_mismatch, common_qos_mismatch_ec))};
            if (!common_qos_mismatch_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure qos_mismatch member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_qos_mismatch = "qos_mismatch";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_qos_mismatch;
            ann_custom_DdsTopic.reset();
            CompleteMemberDetail detail_qos_mismatch = TypeObjectUtils::build_complete_member_detail(name_qos_mismatch, member_ann_builtin_qos_mismatch, ann_custom_DdsTopic);
            CompleteStructMember member_qos_mismatch = TypeObjectUtils::build_complete_struct_member(common_qos_mismatch, detail_qos_mismatch);
            TypeObjectUtils::add_complete_struct_member(member_seq_DdsTopic, member_qos_mismatch);
        }
        {
            TypeIdentifierPair type_ids_data;
            ReturnCode_t return_code_data {eprosima::fastdds::dds::RETCODE_OK};
            return_code_data =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "anonymous_sequence_DdsTopicData_unbounded", type_ids_data);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_data)
            {
                return_code_data =
                    eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                    "DdsTopicData", type_ids_data);

                if (eprosima::fastdds::dds::RETCODE_OK != return_code_data)
                {
                ::register_DdsTopicData_type_identifier(type_ids_data);
                }
                bool element_identifier_anonymous_sequence_DdsTopicData_unbounded_ec {false};
                TypeIdentifier* element_identifier_anonymous_sequence_DdsTopicData_unbounded {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_data, element_identifier_anonymous_sequence_DdsTopicData_unbounded_ec))};
                if (!element_identifier_anonymous_sequence_DdsTopicData_unbounded_ec)
                {
                    EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Sequence element TypeIdentifier inconsistent.");
                    return;
                }
                EquivalenceKind equiv_kind_anonymous_sequence_DdsTopicData_unbounded = EK_COMPLETE;
                if (TK_NONE == type_ids_data.type_identifier2()._d())
                {
                    equiv_kind_anonymous_sequence_DdsTopicData_unbounded = EK_BOTH;
                }
                CollectionElementFlag element_flags_anonymous_sequence_DdsTopicData_unbounded = 0;
                PlainCollectionHeader header_anonymous_sequence_DdsTopicData_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_DdsTopicData_unbounded, element_flags_anonymous_sequence_DdsTopicData_unbounded);
                {
                    SBound bound = 0;
                    PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_DdsTopicData_unbounded, bound,
                                eprosima::fastcdr::external<TypeIdentifier>(element_identifier_anonymous_sequence_DdsTopicData_unbounded));
                    if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                            TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_DdsTopicData_unbounded", type_ids_data))
                    {
                        EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "anonymous_sequence_DdsTopicData_unbounded already registered in TypeObjectRegistry for a different type.");
                    }
                }
            }
            StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_data = 0x00000005;
            bool common_data_ec {false};
            CommonStructMember common_data {TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_data, common_data_ec))};
            if (!common_data_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure data member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_data = "data";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_data;
            ann_custom_DdsTopic.reset();
            CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_DdsTopic);
            CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data);
            TypeObjectUtils::add_complete_struct_member(member_seq_DdsTopic, member_data);
        }
        CompleteStructType struct_type_DdsTopic = TypeObjectUtils::build_complete_struct_type(struct_flags_DdsTopic, header_DdsTopic, member_seq_DdsTopic);
        if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                TypeObjectUtils::build_and_register_struct_type_object(struct_type_DdsTopic, type_name_DdsTopic.to_string(), type_ids_DdsTopic))
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                    "DdsTopic already registered in TypeObjectRegistry for a different type.");
        }
    }
}
// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method
void register_MonitoringTopics_type_identifier(
        TypeIdentifierPair& type_ids_MonitoringTopics)
{

    ReturnCode_t return_code_MonitoringTopics {eprosima::fastdds::dds::RETCODE_OK};
    return_code_MonitoringTopics =
        eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
        "MonitoringTopics", type_ids_MonitoringTopics);
    if (eprosima::fastdds::dds::RETCODE_OK != return_code_MonitoringTopics)
    {
        StructTypeFlag struct_flags_MonitoringTopics = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
                false, false);
        QualifiedTypeName type_name_MonitoringTopics = "MonitoringTopics";
        eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_MonitoringTopics;
        eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_MonitoringTopics;
        CompleteTypeDetail detail_MonitoringTopics = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MonitoringTopics, ann_custom_MonitoringTopics, type_name_MonitoringTopics.to_string());
        CompleteStructHeader header_MonitoringTopics;
        header_MonitoringTopics = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MonitoringTopics);
        CompleteStructMemberSeq member_seq_MonitoringTopics;
        {
            TypeIdentifierPair type_ids_topics;
            ReturnCode_t return_code_topics {eprosima::fastdds::dds::RETCODE_OK};
            return_code_topics =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "anonymous_sequence_DdsTopic_unbounded", type_ids_topics);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_topics)
            {
                return_code_topics =
                    eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                    "DdsTopic", type_ids_topics);

                if (eprosima::fastdds::dds::RETCODE_OK != return_code_topics)
                {
                ::register_DdsTopic_type_identifier(type_ids_topics);
                }
                bool element_identifier_anonymous_sequence_DdsTopic_unbounded_ec {false};
                TypeIdentifier* element_identifier_anonymous_sequence_DdsTopic_unbounded {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_topics, element_identifier_anonymous_sequence_DdsTopic_unbounded_ec))};
                if (!element_identifier_anonymous_sequence_DdsTopic_unbounded_ec)
                {
                    EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Sequence element TypeIdentifier inconsistent.");
                    return;
                }
                EquivalenceKind equiv_kind_anonymous_sequence_DdsTopic_unbounded = EK_COMPLETE;
                if (TK_NONE == type_ids_topics.type_identifier2()._d())
                {
                    equiv_kind_anonymous_sequence_DdsTopic_unbounded = EK_BOTH;
                }
                CollectionElementFlag element_flags_anonymous_sequence_DdsTopic_unbounded = 0;
                PlainCollectionHeader header_anonymous_sequence_DdsTopic_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_DdsTopic_unbounded, element_flags_anonymous_sequence_DdsTopic_unbounded);
                {
                    SBound bound = 0;
                    PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_DdsTopic_unbounded, bound,
                                eprosima::fastcdr::external<TypeIdentifier>(element_identifier_anonymous_sequence_DdsTopic_unbounded));
                    if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                            TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_DdsTopic_unbounded", type_ids_topics))
                    {
                        EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "anonymous_sequence_DdsTopic_unbounded already registered in TypeObjectRegistry for a different type.");
                    }
                }
            }
            StructMemberFlag member_flags_topics = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_topics = 0x00000000;
            bool common_topics_ec {false};
            CommonStructMember common_topics {TypeObjectUtils::build_common_struct_member(member_id_topics, member_flags_topics, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_topics, common_topics_ec))};
            if (!common_topics_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure topics member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_topics = "topics";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_topics;
            ann_custom_MonitoringTopics.reset();
            CompleteMemberDetail detail_topics = TypeObjectUtils::build_complete_member_detail(name_topics, member_ann_builtin_topics, ann_custom_MonitoringTopics);
            CompleteStructMember member_topics = TypeObjectUtils::build_complete_struct_member(common_topics, detail_topics);
            TypeObjectUtils::add_complete_struct_member(member_seq_MonitoringTopics, member_topics);
        }
        CompleteStructType struct_type_MonitoringTopics = TypeObjectUtils::build_complete_struct_type(struct_flags_MonitoringTopics, header_MonitoringTopics, member_seq_MonitoringTopics);
        if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                TypeObjectUtils::build_and_register_struct_type_object(struct_type_MonitoringTopics, type_name_MonitoringTopics.to_string(), type_ids_MonitoringTopics))
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                    "MonitoringTopics already registered in TypeObjectRegistry for a different type.");
        }
    }
}

